<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<script type="text/javascript" language="javascript">
function check()
{
	String inputCode = request.getParameter("code");
	String code = (String)session.getAttribute("rand");
	if ( inputCode.equals(code) )
	{
		alert(code);
		return true;
	}
	else
	{
		alert(code);
		return false;
	}
		
}
</script>
<form name="frm" method="post">
Hello Image Test<br/>
checkCode:<img src="verification.jpg"><br/>
please input the checkCode:<input type="text" name="code" value=""><br/>
<input type="submit" name="btn1" value="check" onclick="javascript:check();">
</form> 
</body>
</html>